<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // const str = "12:21,12:30,11:20";
      // const str = "2023-12-22，2023-12-22，2023-12-22";
      const str = "2023-12-22";

      const reg = /^\d\d\d\d-\d\d-\d\d$/;

      // reg.test(字符串)
      console.log(reg.test(str)); //true
    </script>
  </body>
</html>
